#include "SoundManager.h"
SoundManager* SoundManager::m_instance = NULL;

SoundManager::SoundManager()
{
    
}

SoundManager* SoundManager::getInstance()
{
    if(m_instance == NULL)
        m_instance = new SoundManager();
    return m_instance;
}

void SoundManager::playMusic(bool repeat)
{
    CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic("bg_music_loop.mp3", true);
}

void SoundManager::playSound(ESound sound)
{
    switch (sound)
    {
        case kSound_Aww:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("aww.mp3");
            break;
        case kSound_Yeah:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("yeah.mp3");
            break;
        case kSound_PageSwipe:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("pages_swipe.mp3");
            break;
        case kSound_SettingButton:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("settingsbutton_click.mp3");
            break;
        case kSound_Click:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("button_click.mp3");
            break;
        case kSound_Star:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("star.mp3");
            break;
        case kSound_Add:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("add.mp3");
            break;
        case kSound_Minus:
            CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("minus.mp3");
            break;
    }
}